import type {UserRoutesDefine} from "../types/common.d.ts"

/**
 * 后端返回的用户拥有的路由信息格式
 * 获取时机:登录成功后后端返回,前端存入到pinia中
 * 用于:
 * 1.动态路由--tabs
 * 2.菜单的计算
 */
const userRoutes: UserRoutesDefine = [
    {
        path: "home",
        componentPath: "home/Home",
        meta: {
            authorityName: "首页",
            showInMenu: true,
            icon: "Lock"
        }
    },
    {
        path: "system",
        meta: {
            showInMenu: true,
            authorityName: "系统模块",
            icon: "Connection"
        },
        children: [
            {
                path: "user",
                componentPath: "authority/user/UserManage",
                meta: {
                    showInMenu: true,
                    authorityName: "用户管理",
                    icon: "User"
                },
                children: []
            },
            {
                path: "role",
                componentPath: "authority/role/RoleManage",
                meta: {
                    showInMenu: true,
                    authorityName: "角色管理",
                    icon: "Connection"
                },
                children: [
                    {
                        meta: {
                            authorityName: "新增",
                            showInMenu: false,
                        }
                    },
                    {
                        meta: {
                            authorityName: "编辑",
                            showInMenu: false,
                        }
                    },
                    {
                        meta: {
                            authorityName: "删除",
                            showInMenu: false,
                        }
                    },
                    {
                        meta: {
                            authorityName: "分配权限",
                            showInMenu: false,
                        }
                    }
                ]
            },
            {
                path: "authority",
                componentPath: "authority/auth/AuthorityManage",
                meta: {
                    showInMenu: true,
                    authorityName: "权限管理",
                    icon: "User"
                },
                children: [
                    {
                        meta: {
                            authorityName: "新增",
                            showInMenu: false,
                        }
                    },
                    {
                        meta: {
                            authorityName: "编辑",
                            showInMenu: false,
                        }
                    },
                    {
                        meta: {
                            authorityName: "删除",
                            showInMenu: false,
                        }
                    }]
            }
        ]
    }, {
        path: "file",
        meta: {
            showInMenu: true,
            authorityName: "文件模块",
            icon: "FolderOpened"
        },
        children: [
            {
                path: "manage",
                componentPath: "file/FileManage",
                meta: {
                    showInMenu: true,
                    authorityName: "文件管理",
                    icon: "FolderRemove"
                },
                children: []
            }]
    }
]

export default userRoutes